package cn.wen.springframework.aop.framework;import cn.wen.springframework.aop.AdvisedSupport;/** * @ClassName: ProxyFactory * @Author: 小飞 * @Date: 2023/3/29 20:34 * @Description: 代理工厂 */public class ProxyFactory {    private AdvisedSupport advisedSupport;    public ProxyFactory(AdvisedSupport advisedSupport) {        this.advisedSupport = advisedSupport;    }    public Object getProxy() {        return createAopProxy().getProxy();    }    /**     * 通过判断代理目标配置来创建代理对象     * 默认是 JDK 代理     * @return     */    private AopProxy createAopProxy() {        if (advisedSupport.isProxyTargetClass()) {            return new Cglib2AopProxy(advisedSupport);        }        return new JdkDynamicAopProxy(advisedSupport);    }}